from urllib.parse import urlparse
import httpx


async def read_json_data_from_url(json_url: str):
    # 从url中获取最后json的名字
    parsed_url = urlparse(json_url)
    async with httpx.AsyncClient() as client:
        response = await client.get(json_url)
        response.raise_for_status()  # 自动抛出异常
    json_data = response.json()
    return json_data
